/*
 * UART.cpp
 *
 * Created: 01.05.2012 13:34:01
 *  Author: maxim.karban@gmail.com
 */ 

#include <stdint.h>
#include <avr/io.h>

uint8_t PrintStr(uint8_t * _str, uint8_t cnt = 0){
	int i = 0;
	while (_str[i] != 0){
		
		while ( !( UCSR0A & (1<<UDRE0)));
		
		UDR0 = _str[i];
    i++;
	}
	return i;

}

uint8_t PrintBuf(uint8_t * _str, uint8_t cnt){
	int i = 0;
	while (1){
		
		while ( !( UCSR0A & (1<<UDRE0)));
		
		UDR0 = _str[i];
    i++;
    if(i>=cnt)
      break;
	}
	return i;

}